﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace hegang_winform.services
{
    class FixedTimeTaskService
    {
        private List<FixedTimeTaskObject> fixedTimeTaskObjects;
        public FixedTimeTaskService()
        {
            fixedTimeTaskObjects = new List<FixedTimeTaskObject>();
            fixedTimeTaskObjects.Add((FixedTimeTaskObject)Assembly.Load("hegang_winform").CreateInstance(ConfigurationManager.AppSettings["TaskAtZero"]));
            fixedTimeTaskObjects.Add((FixedTimeTaskObject)Assembly.Load("hegang_winform").CreateInstance(ConfigurationManager.AppSettings["TaskPerHour"]));
        }
        public void executeTask()
        {
            foreach (FixedTimeTaskObject o in fixedTimeTaskObjects)
                o.executeTask();
        }
    }
}
